@extends('layouts/default_admin')

@section('content')

{{ Notification::show() }}

<div class="row">
  <div class="span6" style="margin-bottom: 10px">
    <h3>Clientes</h3>
    <div class="btn-group">
      <a class="btn btn-small" href="{{ url('admin/create/user') }}" title="Crea a un nuevo cliente en el sistema."><i class="icon-plus"></i> Crear Cliente</a>
      <a class="btn btn-small" href="#" id="delete_registers" title="Seleccione uno o mas registros a eliminar." disabled><i class="icon-remove"></i> Eliminar Registros</a>
      <a class="btn btn-small" href="#" id="show_filters" title="Habilita los filtros de búsqueda."><i class="icon-filter"></i> Mostrar Filtros</a>
    </div>
  </div>
</div>
<table id="filters" class="table table-condensed" style="display:none;">
  <tr>
    <td><input type="text" name="name_filter" id="name_filter" class="span2" placeholder="Nombre y Apellido" title="Ingrese el nombre y/o apellido para filtrar" maxlength="30"/></td>
    <td><input type="text" name="ced_filter" id="ced_filter" class="span2" placeholder="Número de Cédula" title="Ingrese el número de cédula para filtrar" maxlength="8"/></td>
    <td><input type="text" name="phone_filter" id="phone_filter" class="span2" placeholder="Número de Teléfono" title="Ingrese el número de teléfono para filtrar" maxlength="11"/></td>
    <td>
      <select class="span2">
        <option value="default">Seleccione</option>
        <option value="1">En Sistema</option>
        <option value="0">Desconectado</option>
      </select>
    </td>
    <td><i class="icon-filter" title="Filtrar"></i></td>
  </tr>
</table>

<table class="table table-hover">
  <thead>
    <tr>
      <th style="width: 10px;"><input id="all" style="margin: 0px;" type="checkbox"/></th>
      <th>Nombre y Apellido</th>
      <th>Cédula</th>
      <th>Teléfono</th>
      <th>Estado</th>
      <th>Activo</th>
      <th>Editar</th>
    </tr>
  </thead>
  <tbody>

    @foreach ($users as $user)
      <tr>
        <td><input id="{{ $user->usr_code }}" style="margin: 0px;" type="checkbox"/></td>
        <td>{{ $user->usr_name }}</td>
        <td>{{ $user->usr_rifci }}</td>
        <td>{{ $user->usr_cellphone }}</td>
        <td>
          @if ($user->usr_status > 0)
            En Sistema
          @else
            Desconectado
          @endif
        </td>
        <td style="padding-left:22px">
          @if ($user->usr_active == 0)
          <i class="icon-ban-circle"></i> 
          @else 
          <i class="icon-ok-circle"></i>
          @endif
        </td>
        <td style="padding-left:22px"><a href="{{ url('admin/edit/user/'.$user->usr_code) }}"><i class="icon-edit" alt="Editar"></i></a></td>
      </tr>
    @endforeach
  </tbody>
</table>
<center>{{ $users->links() }}</center>

{{ Form::open(array('id' => '_delete', 'url' => 'admin/delete', 'style' => 'margin: 0px;')) }}
  <input type="hidden" id="deletereg" name="deletereg" value="" />
  <input type="hidden" id="fec1e92a71" name="fec1e92a71" value="user_usr" />
{{ Form::close() }}

@stop
